import subprocess
import json

try:
    cmd = [
        'rostopic', 'pub', '-1', 
        '/a_shot/isShot', 
        'ss_common_msgs/Status',
        '{"code": true, "message": "", "data": ""}'
    ]
    
    result = subprocess.run(cmd, capture_output=True, text=True, timeout=10)
    
    if result.returncode == 0:
        print("Topic published successfully")
    else:
        print(f"Failed to publish: {result.stderr}")
        
except Exception as e:
    print(f"Error: {e}")